<extend name='Common@Common/common'/>

<block name="title">
	<title><{$pushHistory.title}></title>
</block>

<block name="css">
	<link href="/Application/Home/Static/css/info.css" rel="stylesheet">
	<style type="text/css">
		.content{max-width: 100%; overflow: hidden;}
		.content img{max-width: 100%;}
	</style>
</block>

<block name="body">
	<div style="margin: 15px;">
	  	<h4><{$pushHistory.title}></h4>

	  	<hr size="1" style="color:black"/>
		<div style="border: 1px dashed #efefef; background: #fefefe; padding: 5px; margin: 10px 0px; color:black">
			<{$pushHistory.content}>
		</div>
		<div class="clear-both"></div>
		<div class="content"  style="color:black;"><{$pushHistory.detail|htmlspecialchars_decode}></div>
		<div>
		<span>阅读次数</span> <{$pushHistory.read_counts}> &nbsp;&nbsp;&nbsp;
		<span class="good">
		<img src="/Public/images/black.png" width="25px" height="25px" class="img" /> 赞 </span>
		<span class="counts"><{$pushHistory.good_counts}></span> 
		
<if condition="$push_history_id eq 2669">
		<span onclick="checkrewards2()"><img src="/Public/App/image/reserve.png" width="60px" height="22px"></span>
		<else/>
		<span onclick="checkrewards()"><img src="/Public/images/reward.png" width="30px" height="30px"></span>
		</if>
		</div>
		<input type="hidden" value="<{$push_history_id}>" name="push_history_id" class="push_history_id" />
	</div>
</block>

<block name="js">
<script type="text/javascript" src="/Public/App/js/jquery-1.8.1.js"></script>
	<script type="text/javascript">
	//判断访问终端
	var browser={
		versions:function(){
			var u = navigator.userAgent, 
				app = navigator.appVersion;
			return {
				trident: u.indexOf('Trident') > -1, //IE内核
				presto: u.indexOf('Presto') > -1, //opera内核
				webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
				gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
				mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
				ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
				android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
				iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器
				iPad: u.indexOf('iPad') > -1, //是否iPad
				webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
				weixin: u.indexOf('MicroMessenger') > -1, //是否微信 （2015-01-22新增）
				qq: u.match(/\sQQ/i) == " qq" //是否QQ
			};
		}(),
		language:(navigator.browserLanguage || navigator.language).toLowerCase()
	}
	$('.good').click(function(){
		var id=$('.push_history_id').val();
		$.post('/index.php/Home/Index/good',{id:id},function(data){
			if(data.status==1){
				$('.img').attr('src','/Public/images/black1.png');
				$('.counts').html(data.msg);
			}
		},'json');
	});
	function checkrewards(){
		 //判断是否IE内核
		if(browser.versions.trident)
		{ 
		   alert("is IE");
		}
		//判断是否移动端
		if(browser.versions.android){
			 window.Yunoso.RewardPay();
		  }
		if(browser.versions.ios){
            if(typeof pushViewController != 'undefined' && pushViewController instanceof Function) {
                pushViewController()
			} else {
                window.webkit.messageHandlers.hitMoneyForNews.postMessage({body: 'call js confirm in js'});
            }
		  }
	}
	function checkrewards1(){
	//判断是否IE内核
		if(browser.versions.trident)
		{ 
		   alert("is IE");
		}
		//判断是否移动端
		if(browser.versions.android){
			window.location.href='http://pay.yunoso.cc/index.php/User/Reward/reserve';
			// window.Yunoso_Reward.RewardPay();
		  }
		if(browser.versions.ios){
			alert('仅限于安卓手机才可以预定');
			 //pushViewController();
			 //window.webkit.messageHandlers.pushViewController.postMessage();
		  }
	}
	function checkrewards2(){
	alert('开发中');
	
	}
	</script>

</block>